
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Writing your first patch for Django &#8212; Django 2.2.12.dev20200304094918 documentation</title>
    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/language_data.js"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Using Django" href="../topics/index.html" />
    <link rel="prev" title="What to read next" href="whatsnext.html" />



 
<script type="text/javascript" src="../templatebuiltins.js"></script>
<script type="text/javascript">
(function($) {
    if (!django_template_builtins) {
       // templatebuiltins.js missing, do nothing.
       return;
    }
    $(document).ready(function() {
        // Hyperlink Django template tags and filters
        var base = "../ref/templates/builtins.html";
        if (base == "#") {
            // Special case for builtins.html itself
            base = "";
        }
        // Tags are keywords, class '.k'
        $("div.highlight\\-html\\+django span.k").each(function(i, elem) {
             var tagname = $(elem).text();
             if ($.inArray(tagname, django_template_builtins.ttags) != -1) {
                 var fragment = tagname.replace(/_/, '-');
                 $(elem).html("<a href='" + base + "#" + fragment + "'>" + tagname + "</a>");
             }
        });
        // Filters are functions, class '.nf'
        $("div.highlight\\-html\\+django span.nf").each(function(i, elem) {
             var filtername = $(elem).text();
             if ($.inArray(filtername, django_template_builtins.tfilters) != -1) {
                 var fragment = filtername.replace(/_/, '-');
                 $(elem).html("<a href='" + base + "#" + fragment + "'>" + filtername + "</a>");
             }
        });
    });
})(jQuery);(function($) {
    $(document).ready(function() {
        $(".c-tab-unix").on("click", function() {
            $("section.c-content-unix").show();
            $("section.c-content-win").hide();
            $(".c-tab-unix").prop("checked", true);
        });
        $(".c-tab-win").on("click", function() {
            $("section.c-content-win").show();
            $("section.c-content-unix").hide();
            $(".c-tab-win").prop("checked", true);
        });
    });
})(jQuery);</script>
<link rel="stylesheet" href="../_static/console-tabs.css" type="text/css" />
  </head><body>

    <div class="document">
  <div id="custom-doc" class="yui-t6">
    <div id="hd">
      <h1><a href="../index.html">Django 2.2.12.dev20200304094918 documentation</a></h1>
      <div id="global-nav">
        <a title="Home page" href="../index.html">Home</a>  |
        <a title="Table of contents" href="../contents.html">Table of contents</a>  |
        <a title="Global index" href="../genindex.html">Index</a>  |
        <a title="Module index" href="../py-modindex.html">Modules</a>
      </div>
      <div class="nav">
    &laquo; <a href="whatsnext.html" title="What to read next">previous</a>
     |
    <a href="index.html" title="Getting started" accesskey="U">up</a>
   |
    <a href="../topics/index.html" title="Using Django">next</a> &raquo;</div>
    </div>

    <div id="bd">
      <div id="yui-main">
        <div class="yui-b">
          <div class="yui-g" id="intro-contributing">
            
  <div class="section" id="s-writing-your-first-patch-for-django">
<span id="writing-your-first-patch-for-django"></span><h1>Writing your first patch for Django<a class="headerlink" href="#writing-your-first-patch-for-django" title="Permalink to this headline">¶</a></h1>
<div class="section" id="s-introduction">
<span id="introduction"></span><h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
<p>Interested in giving back to the community a little? Maybe you’ve found a bug
in Django that you’d like to see fixed, or maybe there’s a small feature you
want added.</p>
<p>Contributing back to Django itself is the best way to see your own concerns
addressed. This may seem daunting at first, but it’s really pretty simple.
We’ll walk you through the entire process, so you can learn by example.</p>
<div class="section" id="s-who-s-this-tutorial-for">
<span id="who-s-this-tutorial-for"></span><h3>Who’s this tutorial for?<a class="headerlink" href="#who-s-this-tutorial-for" title="Permalink to this headline">¶</a></h3>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">If you are looking for a reference on how to submit patches, see the
<a class="reference internal" href="../internals/contributing/writing-code/submitting-patches.html"><span class="doc">Submitting patches</span></a>
documentation.</p>
</div>
<p>For this tutorial, we expect that you have at least a basic understanding of
how Django works. This means you should be comfortable going through the
existing tutorials on <a class="reference internal" href="tutorial01.html"><span class="doc">writing your first Django app</span></a>.
In addition, you should have a good understanding of Python itself. But if you
don’t, <a class="reference external" href="https://diveinto.org/python3/table-of-contents.html">Dive Into Python</a> is a fantastic (and free) online book for
beginning Python programmers.</p>
<p>Those of you who are unfamiliar with version control systems and Trac will find
that this tutorial and its links include just enough information to get started.
However, you’ll probably want to read some more about these different tools if
you plan on contributing to Django regularly.</p>
<p>For the most part though, this tutorial tries to explain as much as possible,
so that it can be of use to the widest audience.</p>
<div class="admonition-where-to-get-help admonition">
<p class="first admonition-title">Where to get help:</p>
<p class="last">If you’re having trouble going through this tutorial, please post a message
to <a class="reference internal" href="../internals/mailing-lists.html#django-developers-mailing-list"><span class="std std-ref">django-developers</span></a> or drop by <a class="reference external" href="irc://irc.freenode.net/django-dev">#django-dev on irc.freenode.net</a> to
chat with other Django users who might be able to help.</p>
</div>
</div>
<div class="section" id="s-what-does-this-tutorial-cover">
<span id="what-does-this-tutorial-cover"></span><h3>What does this tutorial cover?<a class="headerlink" href="#what-does-this-tutorial-cover" title="Permalink to this headline">¶</a></h3>
<p>We’ll be walking you through contributing a patch to Django for the first time.
By the end of this tutorial, you should have a basic understanding of both the
tools and the processes involved. Specifically, we’ll be covering the following:</p>
<ul class="simple">
<li>Installing Git.</li>
<li>Downloading a copy of Django’s development version.</li>
<li>Running Django’s test suite.</li>
<li>Writing a test for your patch.</li>
<li>Writing the code for your patch.</li>
<li>Testing your patch.</li>
<li>Submitting a pull request.</li>
<li>Where to look for more information.</li>
</ul>
<p>Once you’re done with the tutorial, you can look through the rest of
<a class="reference internal" href="../internals/contributing/index.html"><span class="doc">Django’s documentation on contributing</span></a>.
It contains lots of great information and is a must read for anyone who’d like
to become a regular contributor to Django. If you’ve got questions, it’s
probably got the answers.</p>
<div class="admonition-python-3-required admonition">
<p class="first admonition-title">Python 3 required!</p>
<p class="last">The current version of Django doesn’t support Python 2.7. Get Python 3 at
<a class="reference external" href="https://www.python.org/downloads/">Python’s download page</a> or with your
operating system’s package manager.</p>
</div>
<div class="admonition-for-windows-users admonition">
<p class="first admonition-title">For Windows users</p>
<p class="last">When installing Python on Windows, make sure you check the option “Add
python.exe to Path”, so that it is always available on the command line.</p>
</div>
</div>
</div>
<div class="section" id="s-code-of-conduct">
<span id="code-of-conduct"></span><h2>Code of Conduct<a class="headerlink" href="#code-of-conduct" title="Permalink to this headline">¶</a></h2>
<p>As a contributor, you can help us keep the Django community open and inclusive.
Please read and follow our <a class="reference external" href="https://www.djangoproject.com/conduct/">Code of Conduct</a>.</p>
</div>
<div class="section" id="s-installing-git">
<span id="installing-git"></span><h2>Installing Git<a class="headerlink" href="#installing-git" title="Permalink to this headline">¶</a></h2>
<p>For this tutorial, you’ll need Git installed to download the current
development version of Django and to generate patch files for the changes you
make.</p>
<p>To check whether or not you have Git installed, enter <code class="docutils literal notranslate"><span class="pre">git</span></code> into the command
line. If you get messages saying that this command could not be found, you’ll
have to download and install it, see <a class="reference external" href="https://git-scm.com/download">Git’s download page</a>.</p>
<p>If you’re not that familiar with Git, you can always find out more about its
commands (once it’s installed) by typing <code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">help</span></code> into the command line.</p>
</div>
<div class="section" id="s-getting-a-copy-of-django-s-development-version">
<span id="getting-a-copy-of-django-s-development-version"></span><h2>Getting a copy of Django’s development version<a class="headerlink" href="#getting-a-copy-of-django-s-development-version" title="Permalink to this headline">¶</a></h2>
<p>The first step to contributing to Django is to get a copy of the source code.
First, <a class="reference external" href="https://github.com/django/django/fork">fork Django on GitHub</a>. Then,
from the command line, use the <code class="docutils literal notranslate"><span class="pre">cd</span></code> command to navigate to the directory
where you’ll want your local copy of Django to live.</p>
<p>Download the Django source code repository using the following command:</p>
<div class="console-block" id="console-block-0">
<input class="c-tab-unix" id="c-tab-0-unix" type="radio" name="console-0" checked>
<label for="c-tab-0-unix" title="Linux/macOS">&#xf17c/&#xf179</label>
<input class="c-tab-win" id="c-tab-0-win" type="radio" name="console-0">
<label for="c-tab-0-win" title="Windows">&#xf17a</label>
<section class="c-content-unix" id="c-content-0-unix">
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> git clone https://github.com/YourGitHubName/django.git
</pre></div>
</div>
</section>
<section class="c-content-win" id="c-content-0-win">
<div class="highlight"><pre><span></span><span class="gp">...\&gt;</span> git clone https://github.com/YourGitHubName/django.git
</pre></div>
</section>
</div>
<div class="admonition-low-bandwidth-connection admonition">
<p class="first admonition-title">Low bandwidth connection?</p>
<p class="last">You can add the <code class="docutils literal notranslate"><span class="pre">--depth</span> <span class="pre">1</span></code> argument to <code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">clone</span></code> to skip downloading
all of Django’s commit history, which reduces data transfer from  ~250 MB
to ~70 MB.</p>
</div>
<p>Now that you have a local copy of Django, you can install it just like you would
install any package using <code class="docutils literal notranslate"><span class="pre">pip</span></code>. The most convenient way to do so is by using
a <em>virtual environment</em>, which is a feature built into Python that allows you
to keep a separate directory of installed packages for each of your projects so
that they don’t interfere with each other.</p>
<p>It’s a good idea to keep all your virtual environments in one place, for
example in <code class="docutils literal notranslate"><span class="pre">.virtualenvs/</span></code> in your home directory.</p>
<p>Create a new virtual environment by running:</p>
<div class="console-block" id="console-block-1">
<input class="c-tab-unix" id="c-tab-1-unix" type="radio" name="console-1" checked>
<label for="c-tab-1-unix" title="Linux/macOS">&#xf17c/&#xf179</label>
<input class="c-tab-win" id="c-tab-1-win" type="radio" name="console-1">
<label for="c-tab-1-win" title="Windows">&#xf17a</label>
<section class="c-content-unix" id="c-content-1-unix">
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> python3 -m venv ~/.virtualenvs/djangodev
</pre></div>
</div>
</section>
<section class="c-content-win" id="c-content-1-win">
<div class="highlight"><pre><span></span><span class="gp">...\&gt;</span> py -m venv <span class="nv">%HOMEPATH%</span>\.virtualenvs\djangodev
</pre></div>
</section>
</div>
<p>The path is where the new environment will be saved on your computer.</p>
<p>The final step in setting up your virtual environment is to activate it:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> <span class="nb">source</span> ~/.virtualenvs/djangodev/bin/activate
</pre></div>
</div>
<p>If the <code class="docutils literal notranslate"><span class="pre">source</span></code> command is not available, you can try using a dot instead:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> . ~/.virtualenvs/djangodev/bin/activate
</pre></div>
</div>
<div class="admonition-for-windows-users admonition">
<p class="first admonition-title">For Windows users</p>
<p>To activate your virtual environment on Windows, run:</p>
<div class="last highlight-doscon notranslate"><div class="highlight"><pre><span></span><span class="gp">...\&gt;</span> <span class="nv">%HOMEPATH%</span>\.virtualenvs\djangodev\Scripts\activate.bat
</pre></div>
</div>
</div>
<p>You have to activate the virtual environment whenever you open a new
terminal window. <a class="reference external" href="https://virtualenvwrapper.readthedocs.io/en/latest/">virtualenvwrapper</a> is a useful tool for making this
more convenient.</p>
<p>The name of the currently activated virtual environment is displayed on the
command line to help you keep track of which one you are using. Anything you
install through <code class="docutils literal notranslate"><span class="pre">pip</span></code> while this name is displayed will be installed in that
virtual environment, isolated from other environments and system-wide packages.</p>
<p id="intro-contributing-install-local-copy">Go ahead and install the previously cloned copy of Django:</p>
<div class="console-block" id="console-block-2">
<input class="c-tab-unix" id="c-tab-2-unix" type="radio" name="console-2" checked>
<label for="c-tab-2-unix" title="Linux/macOS">&#xf17c/&#xf179</label>
<input class="c-tab-win" id="c-tab-2-win" type="radio" name="console-2">
<label for="c-tab-2-win" title="Windows">&#xf17a</label>
<section class="c-content-unix" id="c-content-2-unix">
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> pip install -e /path/to/your/local/clone/django/
</pre></div>
</div>
</section>
<section class="c-content-win" id="c-content-2-win">
<div class="highlight"><pre><span></span><span class="gp">...\&gt;</span> pip install -e \path\to\your\local\clone\django\
</pre></div>
</section>
</div>
<p>The installed version of Django is now pointing at your local copy by installing
in editable mode. You will immediately see any changes you make to it, which is
of great help when writing your first patch.</p>
<div class="section" id="s-creating-projects-with-a-local-copy-of-django">
<span id="creating-projects-with-a-local-copy-of-django"></span><h3>Creating projects with a local copy of Django<a class="headerlink" href="#creating-projects-with-a-local-copy-of-django" title="Permalink to this headline">¶</a></h3>
<p>It may be helpful to test your local changes with a Django project. First you
have to create a new virtual environment, <a class="reference internal" href="#intro-contributing-install-local-copy"><span class="std std-ref">install the previously cloned
local copy of Django in editable mode</span></a>,
and create a new Django project outside of your local copy of Django. You will
immediately see any changes you make to Django in your new project, which is
of great help when writing your first patch.</p>
</div>
</div>
<div class="section" id="s-running-django-s-test-suite-for-the-first-time">
<span id="running-django-s-test-suite-for-the-first-time"></span><h2>Running Django’s test suite for the first time<a class="headerlink" href="#running-django-s-test-suite-for-the-first-time" title="Permalink to this headline">¶</a></h2>
<p>When contributing to Django it’s very important that your code changes don’t
introduce bugs into other areas of Django. One way to check that Django still
works after you make your changes is by running Django’s test suite. If all
the tests still pass, then you can be reasonably sure that your changes
work and haven’t broken other parts Django. If you’ve never run Django’s test
suite before, it’s a good idea to run it once beforehand to get familiar with
its output.</p>
<p>Before running the test suite, install its dependencies by <code class="docutils literal notranslate"><span class="pre">cd</span></code>-ing into the
Django <code class="docutils literal notranslate"><span class="pre">tests/</span></code> directory and then running:</p>
<div class="console-block" id="console-block-3">
<input class="c-tab-unix" id="c-tab-3-unix" type="radio" name="console-3" checked>
<label for="c-tab-3-unix" title="Linux/macOS">&#xf17c/&#xf179</label>
<input class="c-tab-win" id="c-tab-3-win" type="radio" name="console-3">
<label for="c-tab-3-win" title="Windows">&#xf17a</label>
<section class="c-content-unix" id="c-content-3-unix">
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> pip install -r requirements/py3.txt
</pre></div>
</div>
</section>
<section class="c-content-win" id="c-content-3-win">
<div class="highlight"><pre><span></span><span class="gp">...\&gt;</span> pip install -r requirements\py3.txt
</pre></div>
</section>
</div>
<p>If you encounter an error during the installation, your system might be missing
a dependency for one or more of the Python packages. Consult the failing
package’s documentation or search the Web with the error message that you
encounter.</p>
<p>Now we are ready to run the test suite. If you’re using GNU/Linux, macOS, or
some other flavor of Unix, run:</p>
<div class="console-block" id="console-block-4">
<input class="c-tab-unix" id="c-tab-4-unix" type="radio" name="console-4" checked>
<label for="c-tab-4-unix" title="Linux/macOS">&#xf17c/&#xf179</label>
<input class="c-tab-win" id="c-tab-4-win" type="radio" name="console-4">
<label for="c-tab-4-win" title="Windows">&#xf17a</label>
<section class="c-content-unix" id="c-content-4-unix">
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> ./runtests.py
</pre></div>
</div>
</section>
<section class="c-content-win" id="c-content-4-win">
<div class="highlight"><pre><span></span><span class="gp">...\&gt;</span> runtests.py 
</pre></div>
</section>
</div>
<p>Now sit back and relax. Django’s entire test suite has thousands of tests, and
it takes at least a few minutes run, depending on the speed of your computer.</p>
<p>While Django’s test suite is running, you’ll see a stream of characters
representing the status of each test as it completes. <code class="docutils literal notranslate"><span class="pre">E</span></code> indicates that an
error was raised during a test, and <code class="docutils literal notranslate"><span class="pre">F</span></code> indicates that a test’s assertions
failed. Both of these are considered to be test failures. Meanwhile, <code class="docutils literal notranslate"><span class="pre">x</span></code> and
<code class="docutils literal notranslate"><span class="pre">s</span></code> indicated expected failures and skipped tests, respectively. Dots indicate
passing tests.</p>
<p>Skipped tests are typically due to missing external libraries required to run
the test; see <a class="reference internal" href="../internals/contributing/writing-code/unit-tests.html#running-unit-tests-dependencies"><span class="std std-ref">Running all the tests</span></a> for a list of dependencies
and be sure to install any for tests related to the changes you are making (we
won’t need any for this tutorial). Some tests are specific to a particular
database backend and will be skipped if not testing with that backend. SQLite
is the database backend for the default settings. To run the tests using a
different backend, see <a class="reference internal" href="../internals/contributing/writing-code/unit-tests.html#running-unit-tests-settings"><span class="std std-ref">Using another settings module</span></a>.</p>
<p>Once the tests complete, you should be greeted with a message informing you
whether the test suite passed or failed. Since you haven’t yet made any changes
to Django’s code, the entire test suite <strong>should</strong> pass. If you get failures or
errors make sure you’ve followed all of the previous steps properly. See
<a class="reference internal" href="../internals/contributing/writing-code/unit-tests.html#running-unit-tests"><span class="std std-ref">Running the unit tests</span></a> for more information.</p>
<p>Note that the latest Django master may not always be stable. When developing
against master, you can check <a class="reference external" href="https://djangoci.com">Django’s continuous integration builds</a> to
determine if the failures are specific to your machine or if they are also
present in Django’s official builds. If you click to view a particular build,
you can view the “Configuration Matrix” which shows failures broken down by
Python version and database backend.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">For this tutorial and the ticket we’re working on, testing against SQLite
is sufficient, however, it’s possible (and sometimes necessary) to
<a class="reference internal" href="../internals/contributing/writing-code/unit-tests.html#running-unit-tests-settings"><span class="std std-ref">run the tests using a different database</span></a>.</p>
</div>
</div>
<div class="section" id="s-working-on-a-feature">
<span id="working-on-a-feature"></span><h2>Working on a feature<a class="headerlink" href="#working-on-a-feature" title="Permalink to this headline">¶</a></h2>
<p>For this tutorial, we’ll work on a “fake ticket” as a case study. Here are the
imaginary details:</p>
<div class="admonition-ticket-99999-allow-making-toast admonition">
<p class="first admonition-title">Ticket #99999 – Allow making toast</p>
<p class="last">Django should provide a function <code class="docutils literal notranslate"><span class="pre">django.shortcuts.make_toast()</span></code> that
returns <code class="docutils literal notranslate"><span class="pre">'toast'</span></code>.</p>
</div>
<p>We’ll now implement this feature and associated tests.</p>
</div>
<div class="section" id="s-creating-a-branch-for-your-patch">
<span id="creating-a-branch-for-your-patch"></span><h2>Creating a branch for your patch<a class="headerlink" href="#creating-a-branch-for-your-patch" title="Permalink to this headline">¶</a></h2>
<p>Before making any changes, create a new branch for the ticket:</p>
<div class="console-block" id="console-block-5">
<input class="c-tab-unix" id="c-tab-5-unix" type="radio" name="console-5" checked>
<label for="c-tab-5-unix" title="Linux/macOS">&#xf17c/&#xf179</label>
<input class="c-tab-win" id="c-tab-5-win" type="radio" name="console-5">
<label for="c-tab-5-win" title="Windows">&#xf17a</label>
<section class="c-content-unix" id="c-content-5-unix">
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> git checkout -b ticket_99999
</pre></div>
</div>
</section>
<section class="c-content-win" id="c-content-5-win">
<div class="highlight"><pre><span></span><span class="gp">...\&gt;</span> git checkout -b ticket_99999
</pre></div>
</section>
</div>
<p>You can choose any name that you want for the branch, “ticket_99999” is an
example. All changes made in this branch will be specific to the ticket and
won’t affect the main copy of the code that we cloned earlier.</p>
</div>
<div class="section" id="s-writing-some-tests-for-your-ticket">
<span id="writing-some-tests-for-your-ticket"></span><h2>Writing some tests for your ticket<a class="headerlink" href="#writing-some-tests-for-your-ticket" title="Permalink to this headline">¶</a></h2>
<p>In most cases, for a patch to be accepted into Django it has to include tests.
For bug fix patches, this means writing a regression test to ensure that the
bug is never reintroduced into Django later on. A regression test should be
written in such a way that it will fail while the bug still exists and pass
once the bug has been fixed. For patches containing new features, you’ll need
to include tests which ensure that the new features are working correctly.
They too should fail when the new feature is not present, and then pass once it
has been implemented.</p>
<p>A good way to do this is to write your new tests first, before making any
changes to the code. This style of development is called
<a class="reference external" href="https://en.wikipedia.org/wiki/Test-driven_development">test-driven development</a> and can be applied to both entire projects and
single patches. After writing your tests, you then run them to make sure that
they do indeed fail (since you haven’t fixed that bug or added that feature
yet). If your new tests don’t fail, you’ll need to fix them so that they do.
After all, a regression test that passes regardless of whether a bug is present
is not very helpful at preventing that bug from reoccurring down the road.</p>
<p>Now for our hands-on example.</p>
<div class="section" id="s-writing-a-test-for-ticket-99999">
<span id="writing-a-test-for-ticket-99999"></span><h3>Writing a test for ticket #99999<a class="headerlink" href="#writing-a-test-for-ticket-99999" title="Permalink to this headline">¶</a></h3>
<p>In order to resolve this ticket, we’ll add a <code class="docutils literal notranslate"><span class="pre">make_toast()</span></code> function to the
top-level <code class="docutils literal notranslate"><span class="pre">django</span></code> module. First we are going to write a test that tries to
use the function and check that its output looks correct.</p>
<p>Navigate to Django’s <code class="docutils literal notranslate"><span class="pre">tests/shortcuts/</span></code> folder and create a new file
<code class="docutils literal notranslate"><span class="pre">test_make_toast.py</span></code>. Add the following code:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">django.shortcuts</span> <span class="k">import</span> <span class="n">make_toast</span>
<span class="kn">from</span> <span class="nn">django.test</span> <span class="k">import</span> <span class="n">SimpleTestCase</span>


<span class="k">class</span> <span class="nc">MakeToastTests</span><span class="p">(</span><span class="n">SimpleTestCase</span><span class="p">):</span>
    <span class="k">def</span> <span class="nf">test_make_toast</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">assertEqual</span><span class="p">(</span><span class="n">make_toast</span><span class="p">(),</span> <span class="s1">&#39;toast&#39;</span><span class="p">)</span>
</pre></div>
</div>
<p>This test checks that the <code class="docutils literal notranslate"><span class="pre">make_toast()</span></code> returns <code class="docutils literal notranslate"><span class="pre">'toast'</span></code>.</p>
<div class="admonition-but-this-testing-thing-looks-kinda-hard admonition">
<p class="first admonition-title">But this testing thing looks kinda hard…</p>
<p>If you’ve never had to deal with tests before, they can look a little hard
to write at first glance. Fortunately, testing is a <em>very</em> big subject in
computer programming, so there’s lots of information out there:</p>
<ul class="last simple">
<li>A good first look at writing tests for Django can be found in the
documentation on <a class="reference internal" href="../topics/testing/overview.html"><span class="doc">Writing and running tests</span></a>.</li>
<li>Dive Into Python (a free online book for beginning Python developers)
includes a great <a class="reference external" href="https://www.diveinto.org/python3/unit-testing.html">introduction to Unit Testing</a>.</li>
<li>After reading those, if you want something a little meatier to sink
your teeth into, there’s always the Python <a class="reference external" href="https://docs.python.org/3/library/unittest.html#module-unittest" title="(in Python v3.8)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">unittest</span></code></a> documentation.</li>
</ul>
</div>
</div>
<div class="section" id="s-running-your-new-test">
<span id="running-your-new-test"></span><h3>Running your new test<a class="headerlink" href="#running-your-new-test" title="Permalink to this headline">¶</a></h3>
<p>Since we haven’t made any modifications to <code class="docutils literal notranslate"><span class="pre">django.shortcuts</span></code> yet, our test
should fail. Let’s run all the tests in the <code class="docutils literal notranslate"><span class="pre">shortcuts</span></code> folder to make sure
that’s really what happens. <code class="docutils literal notranslate"><span class="pre">cd</span></code> to the Django <code class="docutils literal notranslate"><span class="pre">tests/</span></code> directory and run:</p>
<div class="console-block" id="console-block-6">
<input class="c-tab-unix" id="c-tab-6-unix" type="radio" name="console-6" checked>
<label for="c-tab-6-unix" title="Linux/macOS">&#xf17c/&#xf179</label>
<input class="c-tab-win" id="c-tab-6-win" type="radio" name="console-6">
<label for="c-tab-6-win" title="Windows">&#xf17a</label>
<section class="c-content-unix" id="c-content-6-unix">
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> ./runtests.py shortcuts
</pre></div>
</div>
</section>
<section class="c-content-win" id="c-content-6-win">
<div class="highlight"><pre><span></span><span class="gp">...\&gt;</span> runtests.py shortcuts
</pre></div>
</section>
</div>
<p>If the tests ran correctly, you should see one failure corresponding to the test
method we added, with this error:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="ne">ImportError</span><span class="p">:</span> <span class="n">cannot</span> <span class="kn">import</span> <span class="nn">name</span> <span class="s1">&#39;make_toast&#39;</span> <span class="kn">from</span> <span class="s1">&#39;django.shortcuts&#39;</span>
</pre></div>
</div>
<p>If all of the tests passed, then you’ll want to make sure that you added the
new test shown above to the appropriate folder and file name.</p>
</div>
</div>
<div class="section" id="s-writing-the-code-for-your-ticket">
<span id="writing-the-code-for-your-ticket"></span><h2>Writing the code for your ticket<a class="headerlink" href="#writing-the-code-for-your-ticket" title="Permalink to this headline">¶</a></h2>
<p>Next we’ll be adding the <code class="docutils literal notranslate"><span class="pre">make_toast()</span></code> function.</p>
<p>Navigate to the <code class="docutils literal notranslate"><span class="pre">django/</span></code> folder and open the <code class="docutils literal notranslate"><span class="pre">shortcuts.py</span></code> file. At the
bottom, add:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">make_toast</span><span class="p">():</span>
    <span class="k">return</span> <span class="s1">&#39;toast&#39;</span>
</pre></div>
</div>
<p>Now we need to make sure that the test we wrote earlier passes, so we can see
whether the code we added is working correctly. Again, navigate to the Django
<code class="docutils literal notranslate"><span class="pre">tests/</span></code> directory and run:</p>
<div class="console-block" id="console-block-7">
<input class="c-tab-unix" id="c-tab-7-unix" type="radio" name="console-7" checked>
<label for="c-tab-7-unix" title="Linux/macOS">&#xf17c/&#xf179</label>
<input class="c-tab-win" id="c-tab-7-win" type="radio" name="console-7">
<label for="c-tab-7-win" title="Windows">&#xf17a</label>
<section class="c-content-unix" id="c-content-7-unix">
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> ./runtests.py shortcuts
</pre></div>
</div>
</section>
<section class="c-content-win" id="c-content-7-win">
<div class="highlight"><pre><span></span><span class="gp">...\&gt;</span> runtests.py shortcuts
</pre></div>
</section>
</div>
<p>Everything should pass. If it doesn’t, make sure you correctly added the
function to the correct file.</p>
</div>
<div class="section" id="s-running-django-s-test-suite-for-the-second-time">
<span id="running-django-s-test-suite-for-the-second-time"></span><h2>Running Django’s test suite for the second time<a class="headerlink" href="#running-django-s-test-suite-for-the-second-time" title="Permalink to this headline">¶</a></h2>
<p>Once you’ve verified that your patch and your test are working correctly, it’s
a good idea to run the entire Django test suite just to verify that your change
hasn’t introduced any bugs into other areas of Django. While successfully
passing the entire test suite doesn’t guarantee your code is bug free, it does
help identify many bugs and regressions that might otherwise go unnoticed.</p>
<p>To run the entire Django test suite, <code class="docutils literal notranslate"><span class="pre">cd</span></code> into the Django <code class="docutils literal notranslate"><span class="pre">tests/</span></code>
directory and run:</p>
<div class="console-block" id="console-block-8">
<input class="c-tab-unix" id="c-tab-8-unix" type="radio" name="console-8" checked>
<label for="c-tab-8-unix" title="Linux/macOS">&#xf17c/&#xf179</label>
<input class="c-tab-win" id="c-tab-8-win" type="radio" name="console-8">
<label for="c-tab-8-win" title="Windows">&#xf17a</label>
<section class="c-content-unix" id="c-content-8-unix">
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> ./runtests.py
</pre></div>
</div>
</section>
<section class="c-content-win" id="c-content-8-win">
<div class="highlight"><pre><span></span><span class="gp">...\&gt;</span> runtests.py 
</pre></div>
</section>
</div>
</div>
<div class="section" id="s-writing-documentation">
<span id="writing-documentation"></span><h2>Writing Documentation<a class="headerlink" href="#writing-documentation" title="Permalink to this headline">¶</a></h2>
<p>This is a new feature, so it should be documented. Open the file
<code class="docutils literal notranslate"><span class="pre">docs/topics/http/shortcuts.txt</span></code> and add the following at the end of the
file:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>``make_toast()``
================

.. versionadded:: 2.2

Returns ``&#39;toast&#39;``.
</pre></div>
</div>
<p>Since this new feature will be in an upcoming release it is also added to the
release notes for the next version of Django. Open the release notes for the
latest version in <code class="docutils literal notranslate"><span class="pre">docs/releases/</span></code>, which at time of writing is <code class="docutils literal notranslate"><span class="pre">2.2.txt</span></code>.
Add a note under the “Minor Features” header:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>:mod:`django.shortcuts`
~~~~~~~~~~~~~~~~~~~~~~~

* The new :func:`django.shortcuts.make_toast` function returns ``&#39;toast&#39;``.
</pre></div>
</div>
<p>For more information on writing documentation, including an explanation of what
the <code class="docutils literal notranslate"><span class="pre">versionadded</span></code> bit is all about, see
<a class="reference internal" href="../internals/contributing/writing-documentation.html"><span class="doc">Writing documentation</span></a>. That page also includes
an explanation of how to build a copy of the documentation locally, so you can
preview the HTML that will be generated.</p>
</div>
<div class="section" id="s-previewing-your-changes">
<span id="previewing-your-changes"></span><h2>Previewing your changes<a class="headerlink" href="#previewing-your-changes" title="Permalink to this headline">¶</a></h2>
<p>Now it’s time to go through all the changes made in our patch. To stage all the
changes ready for commit, run:</p>
<div class="console-block" id="console-block-9">
<input class="c-tab-unix" id="c-tab-9-unix" type="radio" name="console-9" checked>
<label for="c-tab-9-unix" title="Linux/macOS">&#xf17c/&#xf179</label>
<input class="c-tab-win" id="c-tab-9-win" type="radio" name="console-9">
<label for="c-tab-9-win" title="Windows">&#xf17a</label>
<section class="c-content-unix" id="c-content-9-unix">
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> git add --all
</pre></div>
</div>
</section>
<section class="c-content-win" id="c-content-9-win">
<div class="highlight"><pre><span></span><span class="gp">...\&gt;</span> git add --all
</pre></div>
</section>
</div>
<p>Then display the differences between your current copy of Django (with your
changes) and the revision that you initially checked out earlier in the
tutorial with:</p>
<div class="console-block" id="console-block-10">
<input class="c-tab-unix" id="c-tab-10-unix" type="radio" name="console-10" checked>
<label for="c-tab-10-unix" title="Linux/macOS">&#xf17c/&#xf179</label>
<input class="c-tab-win" id="c-tab-10-win" type="radio" name="console-10">
<label for="c-tab-10-win" title="Windows">&#xf17a</label>
<section class="c-content-unix" id="c-content-10-unix">
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> git diff --cached
</pre></div>
</div>
</section>
<section class="c-content-win" id="c-content-10-win">
<div class="highlight"><pre><span></span><span class="gp">...\&gt;</span> git diff --cached
</pre></div>
</section>
</div>
<p>Use the arrow keys to move up and down.</p>
<div class="highlight-diff notranslate"><div class="highlight"><pre><span></span><span class="gh">diff --git a/django/shortcuts.py b/django/shortcuts.py</span>
<span class="gh">index 7ab1df0e9d..8dde9e28d9 100644</span>
<span class="gd">--- a/django/shortcuts.py</span>
<span class="gi">+++ b/django/shortcuts.py</span>
<span class="gu">@@ -156,3 +156,7 @@ def resolve_url(to, *args, **kwargs):</span>

     # Finally, fall back and assume it&#39;s a URL
     return to
<span class="gi">+</span>
<span class="gi">+</span>
<span class="gi">+def make_toast():</span>
<span class="gi">+    return &#39;toast&#39;</span>
<span class="gh">diff --git a/docs/releases/2.2.txt b/docs/releases/2.2.txt</span>
<span class="gh">index 7d85d30c4a..81518187b3 100644</span>
<span class="gd">--- a/docs/releases/2.2.txt</span>
<span class="gi">+++ b/docs/releases/2.2.txt</span>
<span class="gu">@@ -40,6 +40,11 @@ database constraints. Constraints are added to models using the</span>
 Minor features
 --------------

<span class="gi">+:mod:`django.shortcuts`</span>
<span class="gi">+~~~~~~~~~~~~~~~~~~~~~~~</span>
<span class="gi">+</span>
<span class="gi">+* The new :func:`django.shortcuts.make_toast` function returns ``&#39;toast&#39;``.</span>
<span class="gi">+</span>
 :mod:`django.contrib.admin`
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~

<span class="gh">diff --git a/docs/topics/http/shortcuts.txt b/docs/topics/http/shortcuts.txt</span>
<span class="gh">index 7b3a3a2c00..711bf6bb6d 100644</span>
<span class="gd">--- a/docs/topics/http/shortcuts.txt</span>
<span class="gi">+++ b/docs/topics/http/shortcuts.txt</span>
<span class="gu">@@ -271,3 +271,12 @@ This example is equivalent to::</span>
         my_objects = list(MyModel.objects.filter(published=True))
         if not my_objects:
             raise Http404(&quot;No MyModel matches the given query.&quot;)
<span class="gi">+</span>
<span class="gi">+``make_toast()``</span>
<span class="gi">+================</span>
<span class="gi">+</span>
<span class="gi">+.. function:: make_toast()</span>
<span class="gi">+</span>
<span class="gi">+.. versionadded:: 2.2</span>
<span class="gi">+</span>
<span class="gi">+Returns ``&#39;toast&#39;``.</span>
<span class="gh">diff --git a/tests/shortcuts/test_make_toast.py b/tests/shortcuts/test_make_toast.py</span>
new file mode 100644
<span class="gh">index 0000000000..6f4c627b6e</span>
<span class="gd">--- /dev/null</span>
<span class="gi">+++ b/tests/shortcuts/test_make_toast.py</span>
<span class="gu">@@ -0,0 +1,7 @@</span>
<span class="gi">+from django.shortcuts import make_toast</span>
<span class="gi">+from django.test import SimpleTestCase</span>
<span class="gi">+</span>
<span class="gi">+</span>
<span class="gi">+class MakeToastTests(SimpleTestCase):</span>
<span class="gi">+    def test_make_toast(self):</span>
<span class="gi">+        self.assertEqual(make_toast(), &#39;toast&#39;)</span>
</pre></div>
</div>
<p>When you’re done previewing the patch, hit the <code class="docutils literal notranslate"><span class="pre">q</span></code> key to return to the
command line. If the patch’s content looked okay, it’s time to commit the
changes.</p>
</div>
<div class="section" id="s-committing-the-changes-in-the-patch">
<span id="committing-the-changes-in-the-patch"></span><h2>Committing the changes in the patch<a class="headerlink" href="#committing-the-changes-in-the-patch" title="Permalink to this headline">¶</a></h2>
<p>To commit the changes:</p>
<div class="console-block" id="console-block-11">
<input class="c-tab-unix" id="c-tab-11-unix" type="radio" name="console-11" checked>
<label for="c-tab-11-unix" title="Linux/macOS">&#xf17c/&#xf179</label>
<input class="c-tab-win" id="c-tab-11-win" type="radio" name="console-11">
<label for="c-tab-11-win" title="Windows">&#xf17a</label>
<section class="c-content-unix" id="c-content-11-unix">
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> git commit
</pre></div>
</div>
</section>
<section class="c-content-win" id="c-content-11-win">
<div class="highlight"><pre><span></span><span class="gp">...\&gt;</span> git commit
</pre></div>
</section>
</div>
<p>This opens up a text editor to type the commit message. Follow the <a class="reference internal" href="../internals/contributing/committing-code.html#committing-guidelines"><span class="std std-ref">commit
message guidelines</span></a> and write a message like:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>Fixed #99999 -- Added a shortcut function to make toast.
</pre></div>
</div>
</div>
<div class="section" id="s-pushing-the-commit-and-making-a-pull-request">
<span id="pushing-the-commit-and-making-a-pull-request"></span><h2>Pushing the commit and making a pull request<a class="headerlink" href="#pushing-the-commit-and-making-a-pull-request" title="Permalink to this headline">¶</a></h2>
<p>After committing the patch, send it to your fork on GitHub (substitute
“ticket_99999” with the name of your branch if it’s different):</p>
<div class="console-block" id="console-block-12">
<input class="c-tab-unix" id="c-tab-12-unix" type="radio" name="console-12" checked>
<label for="c-tab-12-unix" title="Linux/macOS">&#xf17c/&#xf179</label>
<input class="c-tab-win" id="c-tab-12-win" type="radio" name="console-12">
<label for="c-tab-12-win" title="Windows">&#xf17a</label>
<section class="c-content-unix" id="c-content-12-unix">
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$</span> git push origin ticket_99999
</pre></div>
</div>
</section>
<section class="c-content-win" id="c-content-12-win">
<div class="highlight"><pre><span></span><span class="gp">...\&gt;</span> git push origin ticket_99999
</pre></div>
</section>
</div>
<p>You can create a pull request by visiting the <a class="reference external" href="https://github.com/django/django/">Django GitHub page</a>. You’ll see your branch under “Your
recently pushed branches”. Click “Compare &amp; pull request” next to it.</p>
<p>Please don’t do it for this tutorial, but on the next page that displays a
preview of the patch, you would click “Create pull request”.</p>
</div>
<div class="section" id="s-next-steps">
<span id="next-steps"></span><h2>Next steps<a class="headerlink" href="#next-steps" title="Permalink to this headline">¶</a></h2>
<p>Congratulations, you’ve learned how to make a pull request to Django! Details
of more advanced techniques you may need are in
<a class="reference internal" href="../internals/contributing/writing-code/working-with-git.html"><span class="doc">Working with Git and GitHub</span></a>.</p>
<p>Now you can put those skills to good use by helping to improve Django’s
codebase.</p>
<div class="section" id="s-more-information-for-new-contributors">
<span id="more-information-for-new-contributors"></span><h3>More information for new contributors<a class="headerlink" href="#more-information-for-new-contributors" title="Permalink to this headline">¶</a></h3>
<p>Before you get too into writing patches for Django, there’s a little more
information on contributing that you should probably take a look at:</p>
<ul class="simple">
<li>You should make sure to read Django’s documentation on
<a class="reference internal" href="../internals/contributing/writing-code/submitting-patches.html"><span class="doc">claiming tickets and submitting patches</span></a>.
It covers Trac etiquette, how to claim tickets for yourself, expected
coding style for patches, and many other important details.</li>
<li>First time contributors should also read Django’s <a class="reference internal" href="../internals/contributing/new-contributors.html"><span class="doc">documentation
for first time contributors</span></a>.
It has lots of good advice for those of us who are new to helping out
with Django.</li>
<li>After those, if you’re still hungry for more information about
contributing, you can always browse through the rest of
<a class="reference internal" href="../internals/contributing/index.html"><span class="doc">Django’s documentation on contributing</span></a>.
It contains a ton of useful information and should be your first source
for answering any questions you might have.</li>
</ul>
</div>
<div class="section" id="s-finding-your-first-real-ticket">
<span id="finding-your-first-real-ticket"></span><h3>Finding your first real ticket<a class="headerlink" href="#finding-your-first-real-ticket" title="Permalink to this headline">¶</a></h3>
<p>Once you’ve looked through some of that information, you’ll be ready to go out
and find a ticket of your own to write a patch for. Pay special attention to
tickets with the “easy pickings” criterion. These tickets are often much
simpler in nature and are great for first time contributors. Once you’re
familiar with contributing to Django, you can move on to writing patches for
more difficult and complicated tickets.</p>
<p>If you just want to get started already (and nobody would blame you!), try
taking a look at the list of <a class="reference external" href="https://code.djangoproject.com/query?status=new&amp;status=reopened&amp;has_patch=0&amp;easy=1&amp;col=id&amp;col=summary&amp;col=status&amp;col=owner&amp;col=type&amp;col=milestone&amp;order=priority">easy tickets that need patches</a> and the
<a class="reference external" href="https://code.djangoproject.com/query?status=new&amp;status=reopened&amp;needs_better_patch=1&amp;easy=1&amp;col=id&amp;col=summary&amp;col=status&amp;col=owner&amp;col=type&amp;col=milestone&amp;order=priority">easy tickets that have patches which need improvement</a>. If you’re familiar
with writing tests, you can also look at the list of
<a class="reference external" href="https://code.djangoproject.com/query?status=new&amp;status=reopened&amp;needs_tests=1&amp;easy=1&amp;col=id&amp;col=summary&amp;col=status&amp;col=owner&amp;col=type&amp;col=milestone&amp;order=priority">easy tickets that need tests</a>. Just remember to follow the guidelines about
claiming tickets that were mentioned in the link to Django’s documentation on
<a class="reference internal" href="../internals/contributing/writing-code/submitting-patches.html"><span class="doc">claiming tickets and submitting patches</span></a>.</p>
</div>
<div class="section" id="s-what-s-next-after-creating-a-pull-request">
<span id="what-s-next-after-creating-a-pull-request"></span><h3>What’s next after creating a pull request?<a class="headerlink" href="#what-s-next-after-creating-a-pull-request" title="Permalink to this headline">¶</a></h3>
<p>After a ticket has a patch, it needs to be reviewed by a second set of eyes.
After submitting a pull request, update the ticket metadata by setting the
flags on the ticket to say “has patch”, “doesn’t need tests”, etc, so others
can find it for review. Contributing doesn’t necessarily always mean writing a
patch from scratch. Reviewing existing patches is also a very helpful
contribution. See <a class="reference internal" href="../internals/contributing/triaging-tickets.html"><span class="doc">Triaging tickets</span></a> for details.</p>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      
        
          <div class="yui-b" id="sidebar">
            
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../contents.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Writing your first patch for Django</a><ul>
<li><a class="reference internal" href="#introduction">Introduction</a><ul>
<li><a class="reference internal" href="#who-s-this-tutorial-for">Who’s this tutorial for?</a></li>
<li><a class="reference internal" href="#what-does-this-tutorial-cover">What does this tutorial cover?</a></li>
</ul>
</li>
<li><a class="reference internal" href="#code-of-conduct">Code of Conduct</a></li>
<li><a class="reference internal" href="#installing-git">Installing Git</a></li>
<li><a class="reference internal" href="#getting-a-copy-of-django-s-development-version">Getting a copy of Django’s development version</a><ul>
<li><a class="reference internal" href="#creating-projects-with-a-local-copy-of-django">Creating projects with a local copy of Django</a></li>
</ul>
</li>
<li><a class="reference internal" href="#running-django-s-test-suite-for-the-first-time">Running Django’s test suite for the first time</a></li>
<li><a class="reference internal" href="#working-on-a-feature">Working on a feature</a></li>
<li><a class="reference internal" href="#creating-a-branch-for-your-patch">Creating a branch for your patch</a></li>
<li><a class="reference internal" href="#writing-some-tests-for-your-ticket">Writing some tests for your ticket</a><ul>
<li><a class="reference internal" href="#writing-a-test-for-ticket-99999">Writing a test for ticket #99999</a></li>
<li><a class="reference internal" href="#running-your-new-test">Running your new test</a></li>
</ul>
</li>
<li><a class="reference internal" href="#writing-the-code-for-your-ticket">Writing the code for your ticket</a></li>
<li><a class="reference internal" href="#running-django-s-test-suite-for-the-second-time">Running Django’s test suite for the second time</a></li>
<li><a class="reference internal" href="#writing-documentation">Writing Documentation</a></li>
<li><a class="reference internal" href="#previewing-your-changes">Previewing your changes</a></li>
<li><a class="reference internal" href="#committing-the-changes-in-the-patch">Committing the changes in the patch</a></li>
<li><a class="reference internal" href="#pushing-the-commit-and-making-a-pull-request">Pushing the commit and making a pull request</a></li>
<li><a class="reference internal" href="#next-steps">Next steps</a><ul>
<li><a class="reference internal" href="#more-information-for-new-contributors">More information for new contributors</a></li>
<li><a class="reference internal" href="#finding-your-first-real-ticket">Finding your first real ticket</a></li>
<li><a class="reference internal" href="#what-s-next-after-creating-a-pull-request">What’s next after creating a pull request?</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="whatsnext.html"
                        title="previous chapter">What to read next</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="../topics/index.html"
                        title="next chapter">Using Django</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/intro/contributing.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
              <h3>Last update:</h3>
              <p class="topless">Mar 04, 2020</p>
          </div>
        
      
    </div>

    <div id="ft">
      <div class="nav">
    &laquo; <a href="whatsnext.html" title="What to read next">previous</a>
     |
    <a href="index.html" title="Getting started" accesskey="U">up</a>
   |
    <a href="../topics/index.html" title="Using Django">next</a> &raquo;</div>
    </div>
  </div>

      <div class="clearer"></div>
    </div>
  </body>
</html>